package packet

type AdapterInfo struct {
	MaxPackageSize uint32
	Name           string
}

type Adapter interface {
	Name() string
	DumpString() string
	GenHeaderByLen(packageLen uint32) (header []byte)
	GenHeader(originPackage []byte) (header []byte)
	PackNew(originPackage []byte) (newPackage []byte)
	PackTo(originPackage []byte, outPackage []byte, withPayload bool) (copiedSize int)
	UnPack(inputPackage []byte) (originSize uint32, payloadOffset int32)
}

const VariableLengthAdapterName = "VarPack"
const Fixed2LengthAdapterName = "Fix2Pack"
const Fixed4LengthAdapterName = "Fix4Pack"
